<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ChangeEngineToProductTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('products');
        Schema::create('products', function (Blueprint $table) {
            $table->engine = 'innoDb';
            $table->increments('product_id');
            $table->bigInteger('goods_id')->comment('商品id');
            $table->string('name')->comment('产品名');
            $table->string('title')->comment('标题');
            $table->string('bn')->comment('货码');
            $table->decimal('discount_price',20,2)->comment('打折金额');
            $table->decimal('price',20,2)->comment('价格');
            $table->mediumInteger('stock')->comment('库存');
            $table->mediumInteger('p_order')->comment('排序');
            $table->tinyInteger('disabled')->comment('是否删除或者禁用 0-否 1-是')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
